//
//  DataManager.m
//  WeightMaster
//
//  Created by maoyu on 15/8/19.
//  Copyright (c) 2015年 buddysoft. All rights reserved.
//

#import "DataManager.h"

#define kAppSetFinished @"AppSetFinished"

@implementation DataManager

+ (DataManager *)defaultInstance {
    static DataManager * sDefault = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        if (sDefault == nil) {
            sDefault = [[DataManager alloc] init];
        }
    });
    
    return sDefault;
}

- (BOOL)isAppSetFinished {
    NSUserDefaults * ud = [NSUserDefaults standardUserDefaults];
    BOOL result = [ud boolForKey:kAppSetFinished];
    
    return result;
}

- (void)setAppSetFinished {
    NSUserDefaults * ud = [NSUserDefaults standardUserDefaults];
    [ud setObject:[NSNumber numberWithBool:YES] forKey:kAppSetFinished];
    [ud synchronize];
}

@end
